The present invention relates to a technology that may be applied to a non-volatile storage device, for example, to a technology that may be applied to a non-volatile semiconductor memory such as a flash memory or a card storage device such as a multimedia card or a smart media memory card.
Recently, a card storage device, called a memory card containing a non-volatile memory, such as a flash memory, that retains its storage data even after the power has been switched off, is widely used as a data storage medium for portable electronic apparatus such as a digital camera.
As compared with a volatile memory such as a RAM, a non-volatile memory varies widely in its memory device characteristics. At the same time, a non-volatile memory is not designed basically for repeated write operation. Therefore, write errors occur relatively frequently in a memory card in which a non-volatile memory is contained. To solve the above problem, some memory cards containing non-volatile memories execute substitute processing to substitute another area for an area where an error has occurred.
A flash memory, with a two-layer gate structure, stores data by taking advantage of a difference between the threshold voltage levels of the charge stored in the floating gate layer. In this specification, injecting electrons into the floating gate layer to increase the threshold voltage is called a write, and the reverse operation is called an erasure.
Conventionally, even if the write operation is executed under the same condition, a condition (hereinafter called an excessive write error) sometimes occurs in which increasing the write voltage of a storage device in a flash memory sometimes changes the threshold voltage of a particular bit so greatly that the threshold gets out of a desired range. To reduce such excessive write errors, the write voltage should be decreased. However, the problem is that a low write voltage prolongs the time required for writing. So, in general, with priority placed on a shorter write time rather than on a reduction in excessive write errors, the substitute processing described above is performed to recover excessive write error bits. In addition, some conventional memory cards contain an error correction circuit to correct detected error bits before outputting them.
However, excessive write errors occur more frequently as writing and erasure are repeated many times. Thus, a memory card designed to recover excessive write error bits through substitute processing described above, if used for a long time, must perform substitute processing more frequently. This prolongs the total time required for writing and, at the same time, decreases rewrite durability rapidly.
Conventionally, even a memory card containing an error correction circuit is designed to perform substitute processing for a write error even when the error correction circuit is able to correct the error. Therefore, an error correction circuit, if contained in a memory card, cannot prevent a long write time or a rapid decrease in write durability. Investigation made after the application of the present invention reveals that similar inventions, such as JP-A-6-131886 laid-open on May 13, 1994, have been made earlier.